package com.ruoyi.web.zangchat.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.ruoyi.web.zangchat.mapper.ChatLogCashMapper;
import com.ruoyi.web.zangchat.domain.ChatLogCash;
import com.ruoyi.web.zangchat.service.IChatLogCashService;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 现金流水 服务层实现
 *
 * @author wudi
 * @date 2020-07-19
 */
@Service
public class ChatLogCashServiceImpl extends ServiceImpl<ChatLogCashMapper, ChatLogCash> implements IChatLogCashService
{

    @Override
    public List<Map<String, Object>> chatLogCashList(Map<String, Object> map) {

        return baseMapper.chatLogCashList(map);
    }
    @Override
    public ChatLogCash initQlwShopLogCash(Integer type, Long fromId, Long userId, String orderNo, BigDecimal preCash, Integer cashType,
                                          BigDecimal cash, String remark){
        ChatLogCash chatLogCash=new ChatLogCash();
        chatLogCash.setType(type);
        chatLogCash.setFromId(fromId);
        chatLogCash.setUserId(userId);
        chatLogCash.setOrderNo(orderNo);
        chatLogCash.setPreCash(preCash);
        chatLogCash.setCashType(cashType);
        chatLogCash.setCash(cash);
        chatLogCash.setRemark(remark);
        chatLogCash.setCreateTime(new Date());
        return chatLogCash;
    }
}